/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Dao;

import java.util.List;
import model.Recargascodigo;
import model.Reportegeneral;
import org.hibernate.Session;
import util.HibernateUtil;

/**
 *
 * @author David
 */
public class AdminDao {
    
    public List<Recargascodigo> ListRecargasCodigoSinUsar(){
        Session session = HibernateUtil.getSessionFactory().openSession();
        return session.createQuery("from Recargascodigo where estado = 1 ").list();
    }
    
    public Recargascodigo getRecarga(String id){
        Session session = HibernateUtil.getSessionFactory().openSession();
        return (Recargascodigo) session.createQuery("from Recargascodigo where id ="+id).uniqueResult();
    }
    
    public List<Recargascodigo> ListRecargasCodigoUsadas(){
        Session session = HibernateUtil.getSessionFactory().openSession();
        return session.createQuery("from Recargascodigo where estado = 0 ").list();
    }
    
}
